{extend name="admin@index_layout"/}
{block name="main"}
<form class="layui-form" method="post">
    <input type="hidden" name="row[id]" value="{$data.id}">
    <div class="layui-form-item">
        <label class="layui-form-label">预约人信息</label>
        <div class="layui-input-block">
        </div>
        <div class="layui-input-block">
            姓名: {$data.people2}
        </div>
        <div class="layui-input-block">
            电话: {$data.phone2}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">就诊人信息</label>
        <div class="layui-input-block">
        </div>
        <div class="layui-input-block">
        姓名: {$data.people}
        </div>
        <div class="layui-input-block">
            电话: {$data.phone}
        </div>
        <div class="layui-input-block">
            性别: {$data.sex}
        </div>
        <div class="layui-input-block">
            年龄: {$data.age}
        </div>
        <div class="layui-input-block">
            过往病: {$data.past_medical_history}
        </div>
        <div class="layui-input-block">
            历史病: {$data.history_of_allergies}
        </div>
        <div class="layui-input-block">
            备注: {$data.remark}
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
    layui.use(['yznForm', 'laydate', 'form'], function () {
        var yznForm = layui.yznForm,
            laydate = layui.laydate;
        var form = layui.form;
        yznForm.bindevent($("form.layui-form"));
        laydate.render({
            elem: '#ID-laydate'
        });
        form.on('select(ccc6)', function (data) {
            console.log(data.value);
            if (data.value == 3) {
                $(".c5").show();
            } else {
                $(".c5").hide();
            }
            form.render();
        });

        form.on('select(ccc62)', function (data) {
            console.log(data.value);
            $.ajax({
                type: "POST",//规定传输方式
                url: "{:url('getc_cate')}",//提交URL
                data: {'id': data.value},//提交的数据
                success: function (result) {
                    if (result.code == 200) {
                        $("#c-city").empty();
                        var str = "<option value>请选择市</option>";
                        $.each(result.data, function (i, val) {
                            str += '<option value=' + val.name + '>' + val.name + '</option>'
                        });
                        $("#c-city").append(str);

                        $("#c-city2").empty();
                        var str2 = "<option value>请选择区</option>";
                        $("#c-city2").append(str2);

                        layui.form.render('select');
                    }
                },
                error: function () {
                    alert("获取信息失败")
                }
            });
            form.render();
        });

        form.on('select(c-city)', function (data) {
            $.ajax({
                type: "POST",//规定传输方式
                url: "{:url('getc_cate')}",//提交URL
                data: {'id': data.value},//提交的数据
                success: function (result) {
                    if (result.code == 200) {

                        $("#c-city2").empty();
                        var str = "<option value>请选择区</option>";
                        $.each(result.data, function (i, val) {
                            str += '<option value=' + val.name + '>' + val.name + '</option>'
                        });
                        $("#c-city2").append(str);
                        layui.form.render('select');
                    }
                },
                error: function () {
                    alert("获取信息失败")
                }
            });
            form.render();
        });

    });
</script>
{/block}